<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" 
           uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>我的商城</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath }/html/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/html/css/login.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/html/css/invest.css">
	<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
	</script>
	<style>
		.select {
				  width:auto; margin-top:12px; 
			      font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
			      font-size:11px; 
			      color:#999999;
			      line-height:25px;
			      letter-spacing:1px

			}
	</style>
</head>
<body>
  <div class="wrap" style="background-color:#f7f7f7;">

    <div class="header">
     <div class="top">
      <ul id="nav">
        <li><a><span>首页</span></a></li>
        <li><a href="${pageContext.request.contextPath }/employee/register"><span>登记货物</span></a></li>
        <li><a href="${pageContext.request.contextPath }/employee/toEmployeeOrder"><span>查看订单</span></a></li>
        <li><a href="${pageContext.request.contextPath }/employee/toEmployeeMessage"><span>修改员工信息</span></a></li>
        <li><a href="${pageContext.request.contextPath }/user/logout"><span>登出</span></a></li>	
      </ul>
	
    </div><!--top-->
    </div><!--header-->

    <div class="main">
        <div class="withdraw">
            <h3 style="float:left">商品列表 <span></span> 
            </h3>
            <form action="${pageContext.request.contextPath }/goods/selectbycol" 
            	  method="post" style="width:1000px;position:absolute;top:245px;left:268px;">
	            <label class="select">商品类型:</label><input class="selectinput"  type="text" name="type.typename" />
	            <label class="select">商品状态:</label><input class="selectinput"  type="text" name="goods.status" />
	            <label class="select">商品名字:</label><input class="selectinput"  type="text" name="goods.name"/>
	            <input type="submit" value="查询"/>
			</form>
            
            
        </div>
        <div class="invest" style="clear:both;">
            <ul id="investTitle">
          <c:if test="${enhanceList!=null}"> 
          <c:forEach items="${enhanceList}" var="enhance">
                <li>
                    <p class="dkmc" style="font-size:25px">${enhance.goods.name}</p>
                    <div class="investCont">
                        <div style="width: 160px">
                            <p class="lilv">${enhance.discountsMessage.describe}</p>
                            <p class="investTit">商品优惠信息</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585">${enhance.goods.price}<span>元</span></p>
                            <p class="investTit">商品价格</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585">${enhance.type.typename}</p>
                            <p class="investTit">商品类别</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585"><fmt:formatDate value="${enhance.goods.prodate}" pattern="yyyy-MM-dd"/></p>
                            <p class="investTit">生产日期</p>
                        </div>
                        <c:if test="${enhance.goods.effdate!=null&&enhance.goods.effdate!=''}">
	                        <div  style="width: 160px">
	                            <p class="lilv" style="color: #858585"><fmt:formatDate value="${enhance.goods.effdate}" pattern="yyyy-MM-dd"/></p>
	                            <p class="investTit">有效期</p>
	                        </div>
                        </c:if>
                        <c:if test="${enhance.goods.producer!=null&&enhance.goods.producer!=''}">
	                        <div  style="width: 160px">
	                            <p class="lilv" style="color: #858585">${enhance.goods.producer}</p>
	                            <p class="investTit">生产商</p>
	                        </div>
                        </c:if>
                        <c:if test="${enhance.goods.publisher!=null&&enhance.goods.publisher!=''}">
	                        <div  style="width: 160px">
	                            <p class="lilv" style="color: #858585">${enhance.goods.publisher}</p>
	                            <p class="investTit">出版社</p>
	                        </div>
                        </c:if>
                        <c:if test="${enhance.goods.size!=null&&enhance.goods.size!=''}">
	                        <div  style="width: 160px">
	                            <p class="lilv" style="color: #858585">${enhance.goods.size}</p>
	                            <p class="investTit">尺码</p>
	                        </div>
                        </c:if>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585">${enhance.goods.outdate}</p>
                            <p class="investTit">下架日期</p>
                        </div>
                        <div  style="width: 160px">
                            <p class="lilv" style="color: #858585"><label class="status">${enhance.goods.status}</label></p>
                            <p class="investTit" >商品状态</p>
                        </div> 
                        <div style="float:right">
                            <a class="putaway" href="${pageContext.request.contextPath }/goods/toputaway?id=${enhance.goods.id}"><button class="btn1" >上架</button></a>
                        </div>
                    </div>
                </li>
             </c:forEach> 
             </c:if> 
            </ul>
            <div class="fy">
               
            </div>
        </div>
    </div><!--main-->
</div><!--wrap-->
		<c:if test="${jurisdiction}">
			<script>
				(function()
				{
					alert("您没有权限！")
				})();
			</script>
		</c:if>
		<script>
				$(document).ready(function(){
					$.each($(".status"),function(index,content){
						if($(content).text()=="已上架")
						{
							$(".putaway").eq(index).hide();
						}
					})
				})
		</script>
</body>
</html>
